<%@include file="taglib_includes.jsp"%>

<html>
<head>

<title><spring:message code="App.Title"></spring:message></title>
<!-- <script language="javascript" type="text/javascript" src="../js/scripts.js"></script> -->
</head>
<body style="font-family: Arial; font-size: smaller;">
	<center>
		<form:form action="/crud/app/searchContacts" method="post">
			<table style="border-collapse: collapse;" width="500" border="0"
				bordercolor="#006699">
				<tbody>
					<tr>
						<td>Enter Contact Name</td>
						<td><input name="name" type="text"> <input
							value="Search" type="submit">
							<a href="saveContact">New Contact</a>
							</td>
					</tr>
				</tbody>
			</table>
		</form:form>
		<%-- <c:if test="${empty SEARCH_CONTACTS_RESULTS_KEY}">
		</c:if> --%>
		<c:if test="${! empty SEARCH_CONTACTS_RESULTS_KEY}">
			<table style="border-collapse: collapse;" width="500" border="1"
					bordercolor="#006699">
					<tbody>
						<tr bgcolor="lightblue">
							<th>Id</th>
							<th>Name</th>
							<th>Address</th>
							<th>Mobile</th>
							<th></th>
						</tr>
			<c:forEach var="contact" items="${SEARCH_CONTACTS_RESULTS_KEY}">
				<!--  -->
				
						<!-- <tr>
							<td colspan="4">No Results found</td>
						</tr> -->
						<tr>
							<td><c:out value="${contact.id}"></c:out></td>
							<td><c:out value="${contact.name}"></c:out></td>
							<td><c:out value="${contact.address}"></c:out></td>
							<td><c:out value="${contact.mobile}"></c:out></td>
							<td><a href="updateContact/${contact.id}">Edit</a>	
								<a href="deleteContact/${contact.id}">Delete</a>

							</td>
						</tr>
					
				<!--  -->
			</c:forEach>
			</tbody>
				</table>
		</c:if>

	</center>

</body>
</html>
